#pragma once
#include "afxwin.h"
#include "QuestionEditDialog.h"


// CEditFillingDlg dialog

class CEditFillingDlg : public CQuestionEditDialog
{
    DECLARE_DYNAMIC(CEditFillingDlg)

public:
    CEditFillingDlg(CWnd* pParent = NULL);   // standard constructor
    virtual ~CEditFillingDlg();

// Dialog Data
    enum { IDD = IDD_EditFillingQuestion };

protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

    DECLARE_MESSAGE_MAP()
    CString m_blank;
    CString m_replacer;
    CEdit m_editTitle;
    CRichEditCtrl m_titlePreview;

    std::vector<CString> m_answers;
    std::vector<int> m_answerPos;

    int m_editingIndex;

    void SetRichEditText(const CString &str);
    void TokenizeTitle(const CString &str, std::vector<CString> &texts);

protected:
    virtual void OnOK();
    virtual void OnCancel();
public:
    afx_msg void OnEnChangeEditQuestionTitle();
    afx_msg void OnBnClickedButtonAddBlank();
    virtual BOOL OnInitDialog();
    afx_msg void OnEnLinkEditPreview(NMHDR *pNMHDR, LRESULT *pResult);
    CEdit m_blankEdit;
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    afx_msg void OnEnChangeEditBlank();
    afx_msg void OnEnKillfocusEditBlank();
};
